FUNCTION_BLOCK DAC_WordTo2Bytes 
TITLE = 'DAC_WordTo2Bytes'
//
// This functionblock build 2 single bytes of a word  
// 
// Versionshistory:
// 1.0 Ersterstellung E.Dittmann

VERSION : '1.0'
AUTHOR  : 'Lenze'
FAMILY  : 'DAC'
NAME : '2byOfw'
KNOW_HOW_PROTECT

VAR_INPUT
    wInput:                       WORD;                              // Inputdword
END_VAR
    

VAR_OUTPUT
    byOutput1:                    BYTE;                              // Outputbyte 1
    byOutput2:                    BYTE;                              // Outputbyte 2
END_VAR
    
VAR
END_VAR

BEGIN

    byOutput1:=WORD_TO_BYTE(wInput);
    byOutput2:=WORD_TO_BYTE(SHR(IN:=wInput,N:=8));

END_FUNCTION_BLOCK